<extend name="base/Base" />
<block name="Style">
<!-- FooTable Plugin CSS -->
		<link rel="stylesheet" type="text/css" href="__ABSOLUTEADMIN__/vendor/plugins/footable/css/footable.core.min.css">
		<!-- Admin Forms CSS -->
		<link rel="stylesheet" type="text/css" href="__ABSOLUTEADMIN__/assets/admin-tools/admin-forms/css/admin-forms.css">
	
</block>
<block name="Topbar">
								
   <header id="topbar" class="ph10">
        <div class="topbar-left">
          <ul class="nav nav-list nav-list-topbar pull-left">
           
        
			<li   class="active"  >
              <a  href="__APP__/CMS/File/Manage.html"   >文件管理</a>
            </li>
          
          </ul>
        </div>
		
	</header>					 
</block>
<block name="Content">
	<!-- begin: .tray-center -->
        <div class="tray tray-center">

         	<script>
						
					function notice(msg){  
						layer.msg(msg);
					}	
							
							
							</script>
          <!-- recent orders table -->
          <div class="panel">
            <div class="panel-menu p12 admin-form theme-primary">
              <div class="row">
                <div class="col-md-12">
                  <label class="field select">
                    <select id="tid" name="filter-category" >
                   
					   
						  <option value="0" selected="selected">全部分类</option>
						  
						 
				  
                      <volist name="type" id="type">
						<option value="{$type.id}" {$type.selected}>{$type.title}</option>
						   
						</volist>
                    </select>
                    <i class="arrow"></i>
                  </label>
                </div>
				</div>
            </div>
            <div class="panel-body pn" id="batchstatus">
              <div class="table-responsive">
                <table class="table footable"  data-filter="#fooFilter"  data-page-navigation=".pagination" data-page-size="100" >
                  <thead>
                    <tr class="bg-light"> 
					 
					 <th style="width:5%">#</th>
                     
                      <th data-hide="phone,tablet">类型</th>
					<th data-hide="phone,tablet">所属用户</th>
					<th data-hide="phone,tablet">文件名(原文件名)</th>
					
					<th data-hide="phone,tablet">文件大小</th>
					<th data-hide="phone,tablet">上传时间</th>
                      <th data-hide="phone,tablet">操作</th>
													
                      
                    </tr>
                  </thead>
                  <tbody>
				  <volist name="list" id="list">
                    <tr>
						
						<td class="">{$i}</td>
                      
                     	<td>{$list.title_type}</td>
                     
                     <td class="">
                        <img class="img-responsive mw30 ib mr10" title="user" src="{$list.img}">{$list.nickname}(UID:{$list.uid})
                      </td>
					  <td>{$list.title}({$list.original})</td>
					  <td>{$list.size|format_bytes}</td>
                      <td >{$list.time|date="Y-m-d H:i:s",###}</td>
                       <td>
							<a  target="_blank" href="{$list.url}" 
							class="btn btn-xs btn-info">下载</a>
						  
						</td>
                          
							
                           
                      
                    </tr>
                </volist>
				</tbody>
				 <tfoot class="footer-menu">
				<tr>
				  <td colspan="12">
					<nav class="text-right">
					  <ul class="pagination hide-if-no-paging"></ul>
					</nav>
				  </td>
				</tr>
			  </tfoot>
                </table>
              </div>
            </div>
          </div>

		 
				<div class="col-md-12 digg">
				 <br>
					<center>
				 {$pages}
				</center>
				
			  </div>
			  
        </div>
        <!-- end: .tray-center -->

        <!-- begin: .tray-right -->
        <aside class="tray tray-right tray290" data-tray-height="match">
		<form action="__SELF__" method="get">
          <!-- menu quick links -->
          <div class="admin-form">

            <h4>搜索文件</h4>
			提示：<span style="color:red;">为空时则不作为搜索条件</span>

            <hr class="short">

            <div class="section mb15">
              <label for="order-id" class="field prepend-icon">
                <input type="text" name="uid" id="uid" class="gui-input" placeholder="请输入用户UID" value="{$uid}">
                <label for="order-id" class="field-icon">
                  <i class="fa fa-tag"></i>
                </label>
              </label>
            </div>
		
			<h5><small>输入文件大小区间</small></h5>
            <div class="section row mb15">
              <div class="col-md-6">
                <label for="price1" class="field prepend-icon">
                  <input type="text" name="begin_size" id="begin_size" class="gui-input" placeholder="0Byte" value="{$begin_size}">
                  <label for="price1" class="field-icon">
                    <i class="fa fa-long-arrow-down"></i>
                  </label>
                </label>
              </div>
              <div class="col-md-6">
                <label for="price2" class="field prepend-icon">
                  <input type="text" name="end_size" id="end_size" class="gui-input" placeholder="1000Byte" value="{$end_size}">
                  <label for="price2" class="field-icon">
                    <i class="fa fa-long-arrow-up"></i>
                  </label>
                </label>
              </div>
            </div>
			
            <h5><small>请选择开始时间	</small></h5>
            <div class="section row mb15">
              <div class="col-md-12">
                <label for="price1" class="field prepend-icon">
				  <input name="begin_time" placeholder="请输入日期" value='{$begin_time|date="Y-m-d",###}' class="laydate-icon gui-input" onclick="laydate()">
                  <label for="price1" class="field-icon">
                    <i class="fa fa-calendar"></i>
                  </label>
                </label>
              </div>
              
            </div>
			
			 <h5><small>请选择开始结束	</small></h5>
            <div class="section row mb15">
              <div class="col-md-12">
                <label for="price1" class="field prepend-icon">
				  <input name="end_time" placeholder="请输入日期" value='{$end_time|date="Y-m-d",###}' class="laydate-icon gui-input" onclick="laydate()">
                  <label for="price1" class="field-icon">
                    <i class="fa fa-calendar"></i>
                  </label>
                </label>
              </div>
              
            </div>

   

            <h5><small>请选择商品分类</small></h5>
            <div class="section mb15">
              <label class="field select">
                <select id="filter-categories" name="tid">
				
                
				  <option value="0" selected="selected">全部分类</option>
				  
				   <volist name="types" id="types">
						<option value="{$types.id}" {$types.selected}>{$types.title}</option>
						   
						</volist>
                </select>
                <i class="arrow double"></i>
              </label>
            </div>
			
            <hr class="short">

            <div class="section">
                <button class="btn btn-default btn-sm ph25" type="submit" style="width:100%;">搜索文件</button>
               
            </div>

          </div>
		</form>
        </aside>
        <!-- end: .tray-right -->

   

</block>
<block name="Script">
	
  <!-- FooTable Plugin -->
  <script src="__ABSOLUTEADMIN__/vendor/plugins/footable/js/footable.all.min.js"></script>
   <!-- FooTable Addon -->
  <script src="__ABSOLUTEADMIN__/vendor/plugins/footable/js/footable.filter.min.js"></script>

 <script type="text/javascript">
 
	
		function unSelect(){
				
		  $("input[id='batch']").each(function(){
		   $(this).prop("checked",false);
		  });  
		  
	
		}
		
		function selectAll(){
				
		 $("input[id='batch']").each(function(){
		   $(this).prop("checked",true);
		  });  
		  
		}
		
		function reverse(){
				
		 $("input[id='batch']").each(function(){
			$(this).prop("checked",!this.checked);   
		  
			})
		}
		
			
				
	
			
		
				function changeStatus(status){
				
				
						 var goods=$('input[id="batch"]:checked').map(function(){return this.value}).get().join();
						
						if(confirm('是否确认这样操作')){
							$.ajax({
								type:'POST',
								url:"__APP__/SimpleMall/Manage/Goods/batchStatus.html",
								data:{
									
									"goods": goods,
									"status": status,
									
								},
								success:function(data){								
									if (data == 1) {
									alert('操作成功');
									window.location.reload();
									}else{
										alert(data);
									}
								},
								error:function(){
									alert('未知错误');
								}
							
							});	 
						}
								
				
				}
				
				
					$("#tid").change(function(){
						  	var tid = $("#tid").val();
							
							
							var url = '__APP__/CMS/File/Manage.html';
							url = url+'?tid='+tid;
						
							 self.location=url;
							
						
						
					});
					
					
						$("#inventory").change(function(){
						  	var inventory = $("#inventory").val();
							
							
							var url = '__APP__/SimpleMall/Manage/Goods/Detail.html';
							url = url+'?inventory='+inventory;
						
							 self.location=url;
							
						
						
					});
					
						$("#status").change(function(){
						  	var status = $("#status").val();
							
							
							var url = '__APP__/SimpleMall/Manage/Goods/Detail.html';
							url = url+'?status='+status;
						
							 self.location=url;
							
						
						
					});
					
  jQuery(document).ready(function() {

 

    // Init FooTable Examples
    $('.footable').footable();


  });
  </script>
</block>